import request from '@/utils/request'
import store from '@/store/index.js'

export function login(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}

export function getUserBaseInfo() {
  return request({
    url: '/sys/profile',
    method: 'POST'
    // headers: {
    //   Authorization: 'Bearer ' + store.state.user.token
    // }
  })
}

export function getEmployeeBaseInfo(id) {
  return request({
    url: '/sys/user/' + id,
    method: 'GET'
    // headers: {
    //   Authorization: 'Bearer ' + store.state.user.token
    // }
  })
}

export const getUserDetailById = getEmployeeBaseInfo

export function updateEmployeeBaseInfo(data) {
  return request({
    url: '/sys/user/' + data.id,
    method: 'put',
    data
  })
}

